1 Public Class FrmPURCHASE_ORDER_PRINT
2
3     Private Sub cmdCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCancel.Click
4         Me.Close()
5     End Sub
6
7     Private Sub cmdPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdPrint.Click
8         Dim Report As New FrmREPORTS
9         If rbtnone.Checked Then
10             Rpt_SqlStr =
"SELECT * FROM TBL_Purchase_Order WHERE Purchased_Date >='" & Format(dtfrom.Value, "MM/dd/yyyy") & "' AND Purchased_Date <=' " & Format(dtTo.Value, "MM/dd/yyyy") & "'"
11         ElseIf rbtyes.Checked Then
12             Rpt_SqlStr =
"SELECT * FROM TBL_Purchase_Order WHERE Purchased_Date >='" & Format(dtfrom.Value, "MM/dd/yyyy") & "' AND Purchased_Date <='" & Format(dtTo.Value, "MM/dd/yyyy") & "' AND Approved ='Yes'"
13         ElseIf rbselected.Checked Then
14             With FrmPURCHASEORDER
15                 If .listorder.Items.Count >
0 Then
16                     globalFRM =
"PurchaseORder_BySupplier"
17                     .listorder.Focus()
18                 Else
19                     MsgBox(
"Can't continue printing, because there was no record on the list !!", MsgBoxStyle.Information, "Sales and Inventory")
20                     Exit Sub
21                 End If
22                 
23                 Rpt_SqlStr =
"SELECT * " & _
24                              
"FROM TBL_Purchase_Order " & _
25                              
"INNER JOIN TBL_Purchase_Detail ON TBL_Purchase_Order.Purchase_ID = TBL_Purchase_Detail.Purchase_ID " & _
26                              
"INNER JOIN TBL_Category_Item_File ON TBL_Purchase_Detail.Item_ID = TBL_Category_Item_File.Item_ID " & _
27                              
"WHERE TBL_Purchase_Order.Purchase_ID =" & .listorder.FocusedItem.Text
28
29             End With
30         End If
31         Audit_Trail(xUser_ID, TimeOfDay,
"Print Report - Purchase Order ")
32         Me.Close()
33         Report.Show()
34         
'Me.Close()
35         
'FrmREPORTS.Show()
36     End Sub
37 End Class


Gõ tìm kiếm nhanh...